# -*- coding: utf-8 -*-

import os,json

# 项目根目录
# import chardet
#
# DEV = os.path.dirname(os.path.abspath(__file__))
# print(DEV)
#
# # 测试环境URL地址
# DEV = "http://182.92.155.67:8040/business"

def build_data():
    test_data = []
    # 指定文件路径
    json_file = os.path.join(
        os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "data",
        "order_list.json")

    # 打开json文件
    with open(json_file,encoding="GB2312") as f:
        # result = chardet.detect(f.read())
        # encoding = result['encoding']
        # with open(json_file, 'r', encoding=encoding) as f:
            json_data = json.load(f)
            for case_data in json_data:
                desc = case_data.get("desc")
                afterSale = case_data.get("afterSale")
                orderStateCode = case_data.get("orderStateCode")
                orderTypeStr = case_data.get("orderTypeStr")
                test_data.append((afterSale, orderStateCode, orderTypeStr, desc))
        # print(test_data)

    return test_data
# build_data()